package com.qidian.mes.quality.service.impl;

import com.qidian.common.pojo.MESResult;
import com.qidian.mes.pojo.Quality;
import com.qidian.mes.quality.mapper.DefectMapper;
import com.qidian.mes.quality.service.DefectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author gfdycxy
 * @Company cxy
 * @Description
 * @Time 2024/10/16 19:48
 */
@Service
public class DefectServiceImpl implements DefectService {
    @Autowired
    private DefectMapper defectMapper;
    @Override
    public MESResult selectAll() {
        return MESResult.success(defectMapper.selectAll());
    }

    @Override
    public MESResult insert(Quality defect) {
        return defectMapper.insert(defect)==1?MESResult.success():MESResult.error();
    }

    @Override
    public MESResult deleteById(String  defectId) {
        return defectMapper.deleteById(defectId)==1?MESResult.success():MESResult.error();
    }

    @Override
    public MESResult deleteByIds(String [] defectId) {
        return MESResult.success(200,"ok",defectMapper.deleteByIds(defectId));
    }


}